<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE">
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
    <title>待评价</title>
    <link rel="icon" href="assets/img/favicon.ico">

    <link rel="stylesheet" type="text/css" href="/css/webbase.css" />
    <link rel="stylesheet" type="text/css" href="/css/pages-seckillOrder.css" />

    <script type="text/javascript" src="/js/plugins/jquery/jquery.min.js"></script>
    <script type="text/javascript" src="/js/plugins/jquery.easing/jquery.easing.min.js"></script>
    <script type="text/javascript" src="/js/plugins/sui/sui.min.js"></script>
    <script type="text/javascript" src="/js/widget/nav.js"></script>


</head>
<body>
用户名:<input type="text" id="username" placeholder="输入用户名"><br>
密码:<input type="text" id="password" placeholder="输入密码"><br>
<button onclick="resetPassword()">重置密码</button>
</body>
</html>
<script>
    function resetPassword() {
        var username = $("#username").val();
        var password = $("#password").val();
        $.ajax({
            url:"/user/resetPassword",
            type:"post",
            dataType:"json",
            data:{username : username,password : password},
            success:function (result) {
                if (result.code==200){
                    alert("重置密码成功")
                    location.href="/user/toLogin";
                }
            },
            error:function () {
                alert("重置密码失败")
            }
        })
    }
</script>